//
//  TableViewManager_Extras.m
//  funkydog
//
//  Created by Saptarshi Guha on 2/2/08.
//  Copyright 2008 __MyCompanyName__. All rights reserved.
//

#import "TableViewManager_Extras.h"

#import <objc/objc.h>
#import <objc/objc-runtime.h>
#import <objc/objc-class.h>

@implementation TableViewManager(Extras)
+(void)load{
	if (self == [TableViewManager class]){
		Method originalMethod ,replacedMethod;
		originalMethod  = class_getInstanceMethod(self, @selector(_setupColumnsForTableView));
		replacedMethod  = class_getInstanceMethod(self, @selector(my_setupColumnsForTableView));
		method_exchangeImplementations(originalMethod, replacedMethod);
		originalMethod  = class_getInstanceMethod(self, @selector(_columnWithIdentifierTag:));
		replacedMethod  = class_getInstanceMethod(self, @selector(my_columnWithIdentifierTag:));
		method_exchangeImplementations(originalMethod, replacedMethod);
	//	originalMethod  = class_getInstanceMethod(self, @selector(tableView:objectValueForTableColumn:row:));
	//	replacedMethod  = class_getInstanceMethod(self, @selector(mytableView:objectValueForTableColumn:row:));
	//	method_exchangeImplementations(originalMethod, replacedMethod);
		
	}
}
-(id)my_columnWithIdentifierTag:(int)fp8{
	id x=[self my_columnWithIdentifierTag:fp8];
	//NSLog(@"Got %@, %@, for %d",x,[x identifier],fp8);
	return x;
}
- (id)mytableView:(id)fp8 objectValueForTableColumn:(id)fp12 row:(int)fp16{
	id x=[self mytableView:fp8 objectValueForTableColumn:fp12 row:fp16];
	//NSLog(@"%@=[tbv mytableView:%@ objectValueForTableColumn:%@ row:%d",x,fp8,fp12,fp16);
	return x;
}
-(void)my_setupColumnsForTableView{
	[self my_setupColumnsForTableView];//[NSNumber numberWithInteger:98]
	//NSTableColumn *p=[[NSTableColumn alloc] initWithIdentifier:@"Undery"];
	//NSLog(@"hello");
	//[ [self tableView] addTableColumn:p];
	//[_tableColumns addObject:p];
}
@end
